package com.ruoyi.project.er.enums;

import java.util.HashMap;
import java.util.Map;

public enum PaeaErrorReplyStatus {
	 未回复(0, "未回复"),已回复(1, "已回复"),超期已回复(2, "超期已回复"),
		超期未回复(3, "超期未回复");
	private int value;
	private String name;
	private PaeaErrorReplyStatus(int value, String name){
		this.value = value;
		this.name = name;
	}
	public int getValue() {
		return value;
	}
	public String getName() {
		return name;
	}
	

	private static Map<Integer, PaeaErrorReplyStatus> codeMap;
	private static Map<String, PaeaErrorReplyStatus> nameMap;
	static {
		codeMap = new HashMap<Integer, PaeaErrorReplyStatus>();
		nameMap = new HashMap<String, PaeaErrorReplyStatus>();
		for (PaeaErrorReplyStatus status : PaeaErrorReplyStatus.values()) {
			codeMap.put(status.getValue(), status);
			nameMap.put(status.getName(), status);
		}
	}

	public static String getNameByCode(Integer value) {
		if(value==null) return "未回复";
		PaeaErrorReplyStatus status = codeMap.get(value);
		if (status != null) {
			return status.getName();
		}
		return "未回复";
	}
}
